package rq.optimize.luban;

public abstract class CompressionComputer {
    private int quality;
    private int computeSizeValue;
    private int srcWidth;
    private int srcHeight;

    /**
     * @return the picture width of Resource file
     */
    public int getSrcWidth() {
        return srcWidth;
    }

    /**
     * @return the picture height of Resource file
     */
    public int getSrcHeight() {
        return srcHeight;
    }

    /**
     * @return the first compress quality value,value from 100 to 1
     */
    public int getQuality() {
        return quality;
    }

    /**
     * @return the first compress quality value
     */
    public int getComputeSizeValue() {
        return computeSizeValue;
    }

    public abstract int[] calcQualityAndSampleSize(int quality, int computeSizeValue);

    void setSourceValue(int quality, int computeSizeValue, int srcWidth, int srcHeight) {
        this.quality = quality;
        this.computeSizeValue = computeSizeValue;
        this.srcWidth = srcWidth;
        this.srcHeight = srcHeight;
    }

    public boolean isCompressFinish(int kbSize, int newWidth, int newHeight) {
        return false;
    }
}
